//
//  TestHttpsTool.swift
//  SunxianhuaTestApp
//
//  Created by abc on 2021/10/12.
//

import Foundation
class TestHttpsTool: RequestHttpTool {
    
    func requestNewsData(url :String,successCallBlock :((ArticleListModel)->Void)?,failCallBlock :((String?)->Void)?){
        
        
        self.request(method: .get, url: url, parameters: nil) { dic in
            
            HUD.dismiss()
            guard let model = ArticleListModel.deserialize(from: dic) else {
                failCallBlock?("后台返回数据有误")
                return
            }
            successCallBlock?(model)
        } failCallBack: { msg in
            
            HUD.dismiss()
            failCallBlock?(msg)
        }
    }

    override func faillHandle(error: Error? = nil, dic: NSDictionary? = nil) {
        
    }
    
}
